package com.yebxxx.server.service.impl;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yebxxx.server.mapper.EmployeeTrainMapper;
import com.yebxxx.server.pojo.EmployeeTrain;
import com.yebxxx.server.pojo.PageBean;
import com.yebxxx.server.pojo.Teacher;
import com.yebxxx.server.service.IEmployeeTrainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author stx
 * @since 2022-03-23
 */
@Service
public class EmployeeTrainServiceImpl extends ServiceImpl<EmployeeTrainMapper, EmployeeTrain> implements IEmployeeTrainService {
    @Autowired
    private  EmployeeTrainMapper employeeTrainMapper;
    /**
     * 分页查询培训管理
     * @param currentPage
     * @param size
     * @param employeeTrain
     * @param teacher
     * @return
     */

        @Override
    public PageBean getTrainList(Integer currentPage, Integer size, EmployeeTrain employeeTrain, Teacher teacher) {
            Page<EmployeeTrain> page=new Page<>(currentPage,size);
            IPage<EmployeeTrain> employeeIPage=employeeTrainMapper.getTrainList(page,employeeTrain,teacher);
            PageBean pageBean=new PageBean(employeeIPage.getTotal(),employeeIPage.getRecords());
            return pageBean;
    }


}
